package com.chance.cc.crawler.prod.command.trigger.domain.news.bilibili;

import com.chance.cc.crawler.core.CrawlerJob;
import com.chance.cc.crawler.meta.core.bean.CrawlerMetaConstant;
import com.chance.cc.crawler.prod.command.job.domain.news.bilibili.BiliBiliCommonScript;
import com.chance.cc.crawler.prod.command.job.domain.news.bilibili.realtime.BiliBiliRealtimeCrawlerSchedulerJob;
import com.chance.cc.crawler.prod.command.job.domain.news.bilibili.trace.BiliBiliCommentTraceCrawlerSchedulerJob;
import com.chance.cc.crawler.prod.command.job.domain.news.bilibili.trace.BiliBiliTraceCrawlerSchedulerJob;
import com.chance.cc.crawler.prod.command.trigger.CommonCrawlerSchedulerTrigger;

/**
 * @author lt
 * @version 1.0
 * @date 2021-04-10 12:14:04
 * @email okprog@sina.com
 */
public class BiliBiliCommonCrawlerScheduleTrigger extends CommonCrawlerSchedulerTrigger {
    public static void main(String[] args) {
        publishBiliBiliRealtimeScheduleTriggerInfo();
        publishBiliBiliTraceScheduleTriggerInfo();
        publishBiliBiliCommentTraceScheduleTriggerInfo();
    }

    public static void publishBiliBiliRealtimeScheduleTriggerInfo(){
        CrawlerJob crawlerJob = BiliBiliRealtimeCrawlerSchedulerJob.crawlerScheduler();
        metaServiceCommand_17.addOrUpdateScheduleCrawlerTrigger(
                crawlerJob.generateCrawlerKey(),
                crawlerJob.generateCrawlerTriggerKey(),
                BiliBiliCommonScript.domain,
                CrawlerMetaConstant.ScheduleJobTrigger_Cron,
                "0 0/30 * * * ?",
                "哔哩哔哩实时采集任务，每三十分钟采集一次");
    }

    public static void publishBiliBiliTraceScheduleTriggerInfo(){
        CrawlerJob crawlerJob = BiliBiliTraceCrawlerSchedulerJob.crawlerScheduler();
        metaServiceCommand_17.addOrUpdateScheduleCrawlerTrigger(
                crawlerJob.generateCrawlerKey(),
                crawlerJob.generateCrawlerTriggerKey(),
                BiliBiliCommonScript.domain,
                CrawlerMetaConstant.ScheduleJobTrigger_Cron,
                "0 30 0 * * ?",
                "哔哩哔哩追溯7日评论采集任务，每天采集一次");
    }

    public static void publishBiliBiliCommentTraceScheduleTriggerInfo(){
        CrawlerJob crawlerJob = BiliBiliCommentTraceCrawlerSchedulerJob.crawlerScheduler();
        metaServiceCommand_17.addOrUpdateScheduleCrawlerTrigger(
                crawlerJob.generateCrawlerKey(),
                crawlerJob.generateCrawlerTriggerKey(),
                BiliBiliCommonScript.domain,
                CrawlerMetaConstant.ScheduleJobTrigger_Cron,
                "0 0 * * * ?",
                "哔哩哔哩追溯当日评论采集任务，每小时采集一次");
    }
}
